#version 330 core

in vec2 TexCoords;

uniform float Time;
uniform sampler2D image;
uniform vec4 color;

out vec4 FragColor;

void main()
{
	vec3 imgColor = texture2D(image, TexCoords).rgb;
	vec3 mask_color = (imgColor.r+imgColor.g+imgColor.b)/3.0*color.rgb;
	
	float mask_x = TexCoords.x;
	float mask = abs(sin(mask_x+Time));
	vec3 c =mix(imgColor, mask_color, mask);
    
    FragColor = vec4(c, 1.0);
}
